import request from '@/api'

// 本地模拟 表单数据，从接口获取
export function getAllConfigFormData(params = {}) {
  return window.$wujie.props.FromRenderApi.getFormRenderData(params)
}

// 根据模型 ids 集合 查找表单字段
export function getFormFieldsPropertiesByModelIds(params = {}) {
  return window.$wujie.props.DataModelApi.getDataModelFieldsByModelIds(params)
}


export function loadFormJson(id) {
  /*return request({
    url: `${API.VISUAL_API}/bvPageDesign/${id}`,
    method: 'get',
  })*/
}

export function saveFormJson(data) {
  return request.post({
    url: `${API.VISUAL_API}/bvPageDesign/save`,
    method: 'post',
    data,
  })
}

export function loadFormJsonHistory(id) {
  /*return request({
    url: API.VISUAL_API + '/bvPage/' + id,
    method: 'get',
  })*/
}

export function loadFormListWithPageFlag(pageFlag) {
  /*return request({
    url: `${API.VISUAL_API}/bvPage/findCurrentVersionPages`,
    method: 'post',
    params: {
      type: pageFlag,
    },
  })*/
}

export function loadFormJsonWithPageCode(pageCode) {
  /*return request({
    url: API.VISUAL_API + `/bvPage/contextByCode/${pageCode}`,
    method: 'get',
  })*/
}

export function uploadFile(data) {
  /*return request({
    url: `${API.FILE_API}/arcFile/upload`,
    method: 'post',
    data,
  })*/
}

export function downloadFile(id) {
  /*return request({
    url: `${API.FILE_API}/arcFile/download`,
    responseType: 'blob',
    params: {
      id,
    },
  })*/
}

export function deleteFile(id) {
  /*return request({
    url: `${API.FILE_AP}/arcFile/${id}`,
    method: 'delete',
  })*/
}

export function getFileInfo(id) {
  /*return request({
    url: `${API.FILE_API}/arcFile/${id}`,
    method: 'get',
  })*/
}
